/*
 * Copyright (C) 2012-2013  Romain DUBOIS
 * 
 * This file is part of NeMoS - Network and Modular Software
 * 
 * NeMoS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * NeMoS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with NeMoS.  If not, see <http://www.gnu.org/licenses/>.
 */
package nemos.util.swing;

/**
 * IRowConverter : The row converter interface.
 * 
 * <p>
 * A row converter is used by flexible table model to convert an entry object
 * into row data.
 * </p>
 * 
 * @author Romain DUBOIS
 * @param <T>
 *            The type of the objects which represent a row in the table model
 */
public interface IRowConverter<T> {

    /**
     * Get the type of a column data.
     * 
     * @param pColumn
     *            The column
     * @return The column type
     */
    Class<?> getColumnType(int pColumn);

    /**
     * Get the value related to the provided object for the required column.
     * 
     * @param pObject
     *            The object to extract the value from
     * @param pColumn
     *            The column in the table model
     * @return The value
     */
    Object getValue(T pObject, int pColumn);

    /**
     * Get the number of columns in the table model.
     * 
     * @return The column count
     */
    int getColumnCount();
}
